/*
 * Copyright (c) 2025 Huawei Technologies Co., Ltd.
 * openUBMC is licensed under Mulan PSL v2.
 * You can use this software according to the terms and conditions of the Mulan PSL v2.
 * You may obtain a copy of Mulan PSL v2 at:
 *         http://license.coscl.org.cn/MulanPSL2
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PSL v2 for more details.
 */

#ifndef DEVMON_OBJECT_GROUP_H
#define DEVMON_OBJECT_GROUP_H

#include <mc/engine.h>

#include "object_group_interface.h"

namespace devmon {

class object_group_root : public mc::engine::object<object_group_root> {
public:
    MC_OBJECT(object_group_root, "ObjectGroupRoot", "/bmc/dev/ObjectGroup")

    object_group_root() = default;

    static void create_object(mc::engine::service* service);
};

using object_group_root_ptr = mc::shared_ptr<object_group_root>;

class object_group : public mc::engine::object<object_group> {
public:
    MC_OBJECT(object_group, "ObjectGroup", "/bmc/dev/ObjectGroup/${object_name}",
              (object_group_interface))

    object_group() = default;

    void init(std::string position, uint64_t online_timestamp, uint8_t slot);

private:
    object_group_interface m_object_group_interface;
};

using object_group_ptr = mc::shared_ptr<object_group>;

} // namespace devmon

#endif // DEVMON_OBJECT_GROUP_H
